package com.ff.neuropp.domain;

import java.util.Date;
import java.util.List;

import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ff.neuropp.Dto.PageDto;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.neuropp.util.DateSerializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@Entity
@Table(name = "t_course_ware", uniqueConstraints = {@UniqueConstraint(columnNames="id")})
/**
 * 课件表
 * @author sun_weiwu
 *
 */
public class CourseWare extends PageDto {

	 	private static final long serialVersionUID = 1L;


	    @Id
	    @GeneratedValue(strategy = GenerationType.IDENTITY)
	    private int id;
	    
	    @Column(name = "name", columnDefinition = "varchar(100) COMMENT '名称'")
	    @ApiModelProperty(value = "名称")
	    private String name;

		@Column(name = "content", columnDefinition = "varchar(100) COMMENT '描述'")
		@ApiModelProperty(value = "描述")
		private String content;

//	    @Column(name = "file_ids", columnDefinition = "varchar(100) COMMENT '课件地址'")
		@OneToMany(cascade = {CascadeType.ALL})
		@JoinColumn(name = "course_ware_id")
	    @ApiModelProperty(value = "课件地址")
		private List<FileDto> fileList;

		@Column(name = "status",columnDefinition="INT default 1")
		@ApiModelProperty(value = "状态 1、线上 0、下线")
		private Integer status=1;

	    //操作时间
	    @Column(name = "create_time",updatable = false)
	    @org.hibernate.annotations.CreationTimestamp
		@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
		@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	    private Date createDate;
	    
	    @Column(name = "update_time", columnDefinition = "datetime COMMENT '更新时间'")
	    private Date updateTime;
	    
}
